<?php
/**
* @package YaForms
* @copyright Авторские права (C) 2009 www.yar-it.com. Все права защищены.
* @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
* YaForms! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
* Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл copyright.php.
*/

defined( '_VALID_MOS' ) or die( 'Restricted access' );

function afHtmlEditor( $editorlang, $txtdir, $hiddenField ) {

   if ( version_compare( phpversion(), '5', '<' ) ){
	include_once( JPATH_BASE.'/mambots/editors/fckeditor/fckeditor_php4.php' ) ;
   } else {
	include_once( JPATH_BASE.'/mambots/editors/fckeditor/fckeditor_php5.php' ) ;
   }
   if(file_exists(JPATH_BASE.'/mambots/editors/fckeditor/editor/lang/'.$editorlang.'.js')){
      $lang = $editorlang;
   } else {
      $lang = 'en';
   }
   $toolbar = 'Compact';
           
   $html = '<script language="javascript" type="text/javascript" src="'.JPATH_SITE.'/mambots/editors/fckeditor/fckeditor.js"></script>
            <script type="text/javascript">
            var oFCKeditor = new FCKeditor(\''.$hiddenField.'\');
		oFCKeditor.BasePath = "/mambots/editors/fckeditor/" ;
		oFCKeditor.Config["CustomConfigurationsPath"] = "'.JPATH_SITE.'/mambots/editors/fckconfigjoomla.js";
		oFCKeditor.ToolbarSet = "'.$toolbar.'" ;
		oFCKeditor.Config[\'AutoDetectLanguage\'] = "false" ;
                oFCKeditor.Config[\'DefaultLanguage\'] = "'.$lang.'" ;
		oFCKeditor.Config[\'UseBROnCarriageReturn\'] = "false" ;
		oFCKeditor.Config[\'EditorAreaCSS\'] = "'.JPATH_SITE.'/mambots/editors/fckeditor/editor/css/fck_editorarea.css";
		oFCKeditor.Config[\'ContentLangDirection\'] = "'.$txtdir.'" ;
		oFCKeditor.Config[\'SkinPath\'] = oFCKeditor.BasePath + \'editor/skins/\' + \'silver\' + \'/\' ;
		oFCKeditor.Width = "555px" ;
		oFCKeditor.Height = "250px" ;
		oFCKeditor.ReplaceTextarea() ;

		function InsertHTML(field, value) {
		// Get the editor instance that we want to interact with.
		var oEditor = FCKeditorAPI.GetInstance(field) ;
                }
            </script>';
   return $html;

}
?>
